clc;clear;
elps=randn(10000,1);
x(1:2)=0;
for i=3:10000
    x(i)=-0.6*x(i-1)-0.2*x(i-2)+elps(i);
end
xlswrite('mdata.xlsx',x(end-9:end))
dlmwrite('mdata.txt',x)
x=x';
m=ar(x,2)
xhat=forecast(m,x,3)